# -*- coding: utf-8 -*-
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
# 导入对应产品模块的client models。
from tencentcloud.sms.v20210111 import sms_client, models

try:
    cred = credential.Credential("secretId", "secretKey")
    client = sms_client.SmsClient(cred, "ap-guangzhou")
    req = models.SendSmsRequest() # 实例化一个请求对象
    req.SmsSdkAppId = "1400787878" # 短信应用ID

    req.SignName = "腾讯云" # 签名
    req.TemplateId = "449739" # 模板 ID
    req.TemplateParamSet = ["1234"] # 模板参数
    req.PhoneNumberSet = ["+8613711112222"] # 手机号码

    resp = client.SendSms(req)
    # 输出json格式的字符串回包
    print(resp.to_json_string(indent=2))
except TencentCloudSDKException as err:
    print(err)
